#include "CDisplayTimeoutDescriptor.h"


CDisplayTimeoutDescriptor::CDisplayTimeoutDescriptor(void):IDescriptorData(DESCRIPTOR_TAG_TIMEOUT)
{	
}

CDisplayTimeoutDescriptor::~CDisplayTimeoutDescriptor(void)
{
}

void CDisplayTimeoutDescriptor::GetData(BYTE* buff  , int &len)
{
	CBuffer stBuffer(buff,DESCRIPTOR_MAXLEN);
	PACK_DESCRIPTOR_BUFFER_START(stBuffer,DESCRIPTOR_TAG_TIMEOUT);

	std::map<int,int>::iterator iter;
	for(iter = m_mapTimeout.begin();iter != m_mapTimeout.end();iter++)
	{
			stBuffer.Write((BYTE)iter->first);
			stBuffer.Write((BYTE)iter->second);
	} 
	len = PACK_DESCRIPTOR_BUFFER_END(stBuffer);  
}

void CDisplayTimeoutDescriptor::SetSlotTimeout(int nSlotId,int nTimeout)
{
	m_mapTimeout[nSlotId]=nTimeout;
}